<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%
	String path = request.getScheme() + "://" + request.getServerName()
			+ ":" + request.getServerPort() + request.getContextPath();
%>
<!DOCTYPE html>
<html>
<head>
	<title>Detail Admin - Form Showcase</title>
    <meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	
    <!-- bootstrap -->
    <link href="<%=path%><%=path%>/assets/css/bootstrap/bootstrap.css" rel="stylesheet" />
    <link href="<%=path%>/assets/css/bootstrap/bootstrap-overrides.css" type="text/css" rel="stylesheet" />

    <!-- libraries -->
    <link href="<%=path%>/assets/css/lib/uniform.default.css" type="text/css" rel="stylesheet" />
    <link href="<%=path%>/assets/css/lib/select2.css" type="text/css" rel="stylesheet" />
    <link href="<%=path%>/assets/css/lib/bootstrap.datepicker.css" type="text/css" rel="stylesheet" />
    <link href="<%=path%>/assets/css/lib/font-awesome.css" type="text/css" rel="stylesheet" />

    <!-- global styles -->
    <link rel="stylesheet" type="text/css" href="<%=path%>/assets/css/compiled/layout.css" />
    <link rel="stylesheet" type="text/css" href="<%=path%>/assets/css/compiled/elements.css" />
    <link rel="stylesheet" type="text/css" href="<%=path%>/assets/css/compiled/icons.css" />
    
    <!-- this page specific styles -->
    <link rel="stylesheet" href="<%=path%>/assets/css/compiled/form-showcase.css" type="text/css" media="screen" />

    <!-- open sans font -->
    <link href='http://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800' rel='stylesheet' type='text/css' />

    <!--[if lt IE 9]>
      <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->
</head>
<body>

    <%@ include file="navbar.jsp" %>
    <%@ include file="sidebar-nav.jsp" %>

    <div class="content">
        
        <article class="post block">
		    <div class="entry archives">
		        <h2>2015</h2>
		        <ul >
		            <li>
		                <time datetime="2014-08-19T00:00:00+08:00">08/19</time>
		                <a href="/post/input_reg">input文本框输入时正则判断</a>
		                  
		                 <span style="color:#a8ced8;margin-left:30px;">982次浏览</span>
		                   
		            </li>
		            
		            <li>
		                <time datetime="2014-08-19T00:00:00+08:00">08/19</time>
		                <a href="/post/js_regexp">JavaScript RegExp 常用的手机和邮箱正则</a>
		                  
		                 <span style="color:#a8ced8;margin-left:30px;">945次浏览</span>
		                   
		            </li>
		            
		            
		            <li>
		                <time datetime="2014-08-11T00:00:00+08:00">08/11</time>
		                <a href="/post/2n">CentOS安装NodeJS及Express开发框架</a>
		                  
		                 <span style="color:#a8ced8;margin-left:30px;">1408次浏览</span>
		                   
		            </li>
		            
		            <li>
		                <time datetime="2014-08-11T00:00:00+08:00">08/11</time>
		                <a href="/post/1moreyears">时隔多年，个人网站重新上线</a>
		                  
		                 <span style="color:#a8ced8;margin-left:30px;">1359次浏览</span>
		                   
		            </li>
		            
		        </ul>
		        
		    </div>
		</article>
        
    </div>
    <!-- end main container -->

	<!-- scripts for this page -->
    <script src="<%=path%>/assets/js/lib/wysihtml5-0.3.0.js"></script>
    <script src="<%=path%>/assets/js/lib/jquery-1.11.1.min.js"></script>
    <script src="<%=path%>/assets/js/lib/bootstrap.min.js"></script>
    <script src="<%=path%>/assets/js/lib/bootstrap.datepicker.js"></script>
    <script src="<%=path%>/assets/js/lib/jquery.uniform.min.js"></script>
    <script src="<%=path%>/assets/js/lib/select2.min.js"></script>
    <script src="<%=path%>/assets/js/lib/theme.js"></script>
    <script src="<%=path%>/assets/js/underscore/underscore.js"></script>
    <script src="<%=path%>/assets/js/backbone/backbone.js"></script>

    <!-- call this page plugins -->
    <script type="text/javascript">
        $(function () {

            // add uniform plugin styles to html elements
            $("input:checkbox, input:radio").uniform();

            // select2 plugin for select elements
            $(".select2").select2({
                placeholder: "Select a State"
            });

            // datepicker plugin
            $('.input-datepicker').datepicker().on('changeDate', function (ev) {
                $(this).datepicker('hide');
            });
            
            var Article = Backbone.Model.extend({
            	url: '/article/list/1',
            	initialize: function(){
            		
            	}
            });
            
            var Article = new Article;
            Article.fetch({success: function(model,response){
            	console.log(model);
            	var page = response.params.page;
            	var arts = page.items;
            	var html = '';
            	_.each(arts, function(art){
            		html += '<li><time datetime="2014-08-19T00:00:00+08:00"></time>'
            				+ '<a href="/post/input_reg">'+art.caption+'</a>'
            				+ '<span style="color:#a8ced8;margin-left:30px;">982次浏览</span></li>';
            	});
            	$(".archives ul").append($(html));
            	
            },error:function(){
                //当返回格式不正确或者是非json数据时，会执行此方法
                alert('error');
            }});
        });
    </script>
</body>
</html>